<!DOCTYPE html>
<head>
  <meta charset="UTF-8">
  <title>系统</title>
  <style>
      /* 整体页面背景颜色 */
      body {
          background-color: #f4f4f4;
          font-family: Arial, sans-serif;
      }

      /* 头部样式 */
      header {
          background-color: #333;
          color: white;
          text-align: center;
          padding: 20px;
      }

      /* 导航栏样式 */
      nav {
          background-color: #444;
          color: white;
          text-align: center;
          padding: 10px;
      }

      nav ul {
          list-style-type: none;
          margin: 0;
          padding: 0;
      }

      nav ul li {
          display: inline;
          margin-right: 20px;
      }

      nav ul li a {
          color: white;
          text-decoration: none;
      }

      /* 主体内容样式 */
      section {
          padding: 20px;
      }

      /* 页脚样式 */
      footer {
          background-color: #333;
          color: white;
          text-align: center;
          padding: 10px;
      }
  </style>
</head>

<html>
<head>
  <title>Beego</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body>
  <header>
    <h1 class="logo" style="color: aquamarine;">名字: <label id ="username"> </h1>
      <br>
    <label id = "sn"></label>  <br>
    <label id = "sex"></label>  <br>
    <label id = "pswd"></label>  <br>
  </header>
  <footer>
    <div class="author">
    
      Official website:
      <a href="http://{{.Website}}">{{.Website}}</a> /
      Contact me:
      <a class="email" href="mailto:{{.Email}}">{{.Email}}</a>
    </div>
  </footer>
  <div class="backdrop"></div>
  <script>
    function getInfo() {
      let userinfo = localStorage.getItem("userinfo");
      if(userinfo == null){
        alert("要先登陆");
        window.location.href = "/login"
        return
      }
      let user = JSON.parse(userinfo);
      document.getElementById("username").textContent = user.Name;
      document.getElementById("sn").textContent = user.Sn;
      document.getElementById("sex").textContent = user.Sex;
      document.getElementById("pswd").textContent = user.Pswd;
    }
  getInfo()
    
  </script>
</body>
</html>
